<template>
    <div class="parent">
        <header class="header">
            <x-header class="headerContent" :left-options="{backText: ''}"><span class="title">发票记录</span></x-header>
        </header>
        <scroller lock-x @on-scroll="onScroll" ref="scrollerEvent">
        <ul class="list">
            <li class="listItem" v-for="(item, index) in datalist" :key="index">
                <p class="name_title">{{item.title}}</p>
                <p class="name_date">{{item.date}}</p>
                <p class="name_explain">{{item.type}}</p>
            </li>
        </ul>
        </scroller>
    </div>
</template>
<script>
import { XHeader, Scroller } from 'vux'
export default {
    name: 'Record',
    data () {
        return {
            datalist: [],
            scrollTop: 0
        }
    },
    components: {
        XHeader,
        Scroller
    },
    created () {
        // this.$axios.post('http://192.168.1.26:8080/app/mock/16/api/record').then((res) => {
        //     this.datalist = res.data.page
        //     // console.log(res.data.page)
        // })
    },
    mounted () {
        this.$nextTick(() => {
            this.$refs.scrollerEvent.reset({top: 0})
        })
    },
    methods: {
        onScroll (pos) {
            this.scrollTop = pos.top
        },
    }
}
</script>
<style scoped lang="less">
.parent{
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 1);
}
.header{
    width: 100%;
}
.title{
    font-size: 16px;
    font-family:ArialMT;
    color:rgba(255,255,255,1);
    line-height:18px;
    letter-spacing:1px;
}
.headerContent{
    width: 100%;
    background:linear-gradient(135deg,rgba(255,199,38,1) 0%,rgba(249,151,22,1) 100%);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}
.list{
    width: 100%;
    flex: 1;
    overflow: hidden;
    padding-bottom: 2.666667rem;
    .listItem{
        width: 100%;
        height: 1.946667rem;
        background: #fff;
        margin-top: 0.1rem;
        padding: 0 .48rem;
        position: relative;
        .name_title{
            width: 100%;
            height: .666667rem;
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            font-size:14px;
            font-family:PingFangSC-Regular;
            font-weight:400;
            color:rgba(82,82,82,1);
            line-height:20px;
            letter-spacing:1px;
        }
        .name_date {
            width: 100%;
            height: .533333rem;
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            font-size:12px;
            font-family:ArialMT;
            color:rgba(204,204,204,1);
            line-height:14px;
            letter-spacing:1px;
        }
        .name_explain{
            width: 100%;
            height: .533333rem;
            display: flex;
            flex-direction: row;
            justify-content: flex-start;
            align-items: center;
            font-size:12px;
            font-family:ArialMT;
            color:rgba(204,204,204,1);
            line-height:14px;
            letter-spacing:1px;
        }
    }
    .listItem:after{
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        background: #cccccc;
        width: 100%;
        height: 1px;
        -webkit-transform: scaleY(0.5);
        transform: scaleY(0.5);
        -webkit-transform-origin: 0 0;
        transform-origin: 0 0;
    }
}
</style>
